home *** CD-ROM | disk | FTP | other *** search
- // HELP.SLT
- // This demonstrates a full 24 line help screen that covers all available
- // screen space on Telix. Create your own custom help screen and change
- // fname to call it.
-
- str buf[3840]; // array to store screen in - 24 lines by 160 per line
- // including char and attribute
-
- main()
-
- {
- int f,x,cx,cy;
- str s[100];
- str fname[67] = "cis.hlp"; // name of help screen file
- // if you include the full-path name, you will be able to access this
- // from any directory
-
- int color = 14; // change this to suit your tastes
- int c=0; // column position to start
- int r=0; // row position to start
-
- int lines=24; // number of lines of text in file
-
- cy = gety(); // get current cursor position (x and y)
- cx = getx();
- cursor_onoff(0); // turn cursor off
-
- for (x=r;x<lines+r;x = x + 1) // save screen into array
- vgetchrsa(0, x, buf,(x*160), 80); // saves whole row into array
-
- x = r;
- f = fopen(fname, "r"); // open file name to put on screen
- if (ferror(f))
- {
- prints("Error opening file for reading ( File should be in Telix DIR )" );
- // include the full path name to avoid this error
- }
- else
- {
- while (1) // displays contents of text file
- {
- fgets(s, 100, f);
- if( feof(f) )
- break;
- pstraxy( s, c, x, color);
- x = x + 1;
- }
- }
- fclose(f);
-
- x = inkeyw(); // if key = Esc, restore screen, otherwise leave
- if (x == 27) // help screen intact while in terminal mode
- for (x=r;x<lines+r;x = x + 1)
- vputchrsa( 0, x, buf, (x*160), 80 );
-
- // prints();
- cursor_onoff(1); // turn cursor back on
- gotoxy(cx,cy); // restore cursor to its postion
- }
-
-